<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">

<section class="content-header">
    <h1>[[${reportTypeName}]]</h1>
</section>
<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header">
                    <form id="queryForm" onsubmit="return false;">
                        <div class="row">
                            <div class="form-inline">
                                <div class="form-group">
                                    <label for="query-proCode">项目编号</label>
                                    <input id="query-proCode" type="text" name="proCode" class="form-control"
                                           th:value="${proCode}" readonly>
                                    <input  type="hidden" name="reportType" th:value="${reportType}">
                                </div>
                                <div class="form-group">
                                    <label for="query-proName">项目名称</label>
                                    <input id="query-proName" type="text" name="proName" class="form-control"
                                           th:value="${proName}" readonly>
                                </div>
                                <div class="form-group">
                                    <label for="query-proNum">项目数量</label>
                                    <input id="query-proNum" type="text" name="proNum" class="form-control"
                                           th:value="${proNum}" readonly>
                                </div>
                                <div class="form-group">
                                    <label for="query-malType">类型</label>
                                    <select id="query-malType" class="form-control" name="malType">
                                        <option value="" selected>请选择</option>
                                        <option th:each="type : ${malTypes}" th:value="${type.name}"
                                                th:text="${type.name}"></option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label for="query-part">部分</label>
                                    <input id="query-part" type="text" name="part" class="form-control"
                                           placeholder="请输入部分">
                                </div>
                                <!--<div class="form-group">-->
                                    <!--<label for="query-branchName">提报科室</label>-->
                                    <!--<input id="query-branchName" type="text" name="branchName" class="form-control">-->
                                <!--</div>-->
                                <!--<div class="form-group">-->
                                    <!--<label for="query-postName">提报人</label>-->
                                    <!--<input id="query-postName" type="text" name="postName" class="form-control">-->
                                <!--</div>-->

                                <!--<div class="form-group">-->
                                    <!--<label for="query-startTime">日期</label>-->
                                    <!--<input id="query-startTime" type="text" class="form-control datepicker" name="startTime"-->
                                           <!--readonly="readonly"/>-->
                                    <!--<label for="query-endTime"> 至 </label>-->
                                    <!--<input id="query-endTime" type="text" class="form-control datepicker" name="endTime"-->
                                           <!--readonly="readonly"/>-->
                                <!--</div>-->
                                <button type="button" class="btn btn-success" id="btn-search"
                                        onclick="js.table.search(table)">
                                    <span class="Bold">搜索</span>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="box-body">
                    <table id="bootstrap-table"></table>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    let table;

    $(function () {

        /** 加载列表 */
        table = js.table.init({
            url: ctx + "craft/proQuery/makeResultList",
            showExport: false,
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "类型", field: 'malType',width:'70'},
                {title: "部分", field: 'part',width:'150'},
                {title: "提报类型", field: 'reportType',
                    formatter: function (value) {
                        if (value == 2) {

                            return '<span >外协件</span>';
                        } else if(value == 3){
                            return '<span >原材料</span>';
                        }
                    }},
                {title: "物料描述", field: 'malDesc',width:'200'},
                {title: "数量", field: 'num'},
                {title: "单位", field: 'unit'},
                {title: "型号/标准号", field: 'standard',width:'150'},
                {title: "品牌", field: 'brand',width:'100'},
                {title: "提报人", field: 'postName'},
                {title: "提报科室", field: 'branchName'},
                {title: "提报日期", field: 'createTime'},
                {title: "备注", field: 'remark',width:'150'}
                // {title: "批准时间", field: 'verifyTime'}
            ]
        });


    });
</script>
</body>
</html>
